0%

Linux 服务器配置

Oh My Zsh

Installation

  1. Install Zsh

    1
    sudo apt install zsh
  2. Install Oh My Zsh

    1
    sh -c "$(wget -O- https://gitee.com/mcornella/ohmyzsh/raw/master/tools/install.sh)"
  3. Config ZSH
    修改 .zshrc 文件,添加 conda,cuda 等路径

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    __conda_setup="$('/home/xxxx/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
    eval "$__conda_setup"
    else
    if [ -f "/home/xxxx/anaconda3/etc/profile.d/conda.sh" ]; then
    . "/home/xxxx/anaconda3/etc/profile.d/conda.sh"
    else
    export PATH="/home/bjy/anaconda3/bin:$PATH"
    fi
    fi
    unset __conda_setup

    export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64:$LD_LIBRARY_PATH
    export PATH=$PATH:/usr/local/cuda-11.1/bin
  4. Change theme
    修改 .zshrc 文件

    1
    ZSH_THEME="af-magic"

Plugins

Autosuggestions

  1. 首先从 GitHub 下载插件

    1
    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  2. 再修改 .zshrc 配置文件

    1
    2
    plugins=(git)
    plugins=(git zsh-autosuggestions)

SSH

  1. 客户端生成密钥对(之前生成过就不用这一步了)

    1
    ssh-keygen -t rsa
  2. 使用指令直接将公钥传送至服务器

    1
    ssh-copy-id bje@10.176.62.5

免密码ssh登陆就设置完成了。


Reference

https://github.com/ohmyzsh/ohmyzsh